<template>
	<!-- 首页-店铺-商家 -->
	<view class="shopContent">
		<view class="schoolLoaction">
			<view class="addLocation">{{ arr.address }}</view>
			<view class="" @click="callphone">
				<image src="../../static/order/phone.png" mode=""></image>
			</view>
		</view>
		<view class="imgContent">
			<view class="picList">
				<image :src="$image + arr.logo" mode=""></image>
			</view>
		</view>
		<view class="certificate" @click="goCertificate">
			查看食品安全证书<text class="goCertificate">></text>
		</view>
		<view class="certificate" @click="showzizhibabankuai = true">
			查看资质版块<text class="goCertificate">></text>
		</view>
		<view class="service">
			配送服务：由校宇通专送为您提供配送服务
		</view>
		<view class="time">
			<!-- 配送时间：周一至周日09:00-24:00  arr.work_week -->
			配送时间：{{ week }}&ensp;{{ arr.start_time }}-{{ arr.end_time }}
		</view>
		<view class="shop">
			<view class="title">商家服务</view>
			<view class="compensation">
				<text class="pei"></text>商家原因导致订单取消，赔付代金券
			</view>
			<view class="protect">
				<text class="bao"></text>该商户食品安全已由众安保险承保，食品安全有保障
			</view>
		</view>
		<!-- 食品安全证书 -->
		<u-popup v-model="showCertificate" mode="bottom" border-radius="18" height="701rpx" :closeable="true">
			<view class="content_Cert">
				<view class="bookTitle">食品安全证书</view>
				<image src="../../static/index/noResult.png" v-if="arr.food_safe_img == ''"></image>
				<text v-if="arr.food_safe_img == ''">暂无食品安全证书</text>
				<image :src="$image + arr.food_safe_img" mode="" v-if="arr.food_safe_img"></image>
			</view>
		</u-popup>
		<!-- 资质版块 -->
		<u-popup v-model="showzizhibabankuai" mode="bottom" border-radius="18" height="701rpx" :closeable="true">
			<view class="content_Cert">
				<view class="bookTitle">资质版块</view>
				<image src="../../static/index/noResult.png" v-if="arr.trade_license_img == ''"></image>
				<text v-if="arr.trade_license_img == ''">暂无资质版块</text>
				<image :src="$image + arr.trade_license_img" mode="" v-if="arr.trade_license_img"></image>
			</view>
		</u-popup>
	</view>
</template>

<script>
export default {
	// props:{
	// 	imgList:{
	// 		type:Array,
	// 		default:false
	// 	},
	// 	certificate: {
	// 		type: Function,
	// 		default: null
	// 	},
	// 	callNumber: {
	// 		type: Function,
	// 		default: null
	// 	},
	// 	shopPhone: {
	// 		type: Number,
	// 		default: null
	// 	}
	// },
	// 'imgList','callNumber',
	props: ['certificate', 'arr'],
	data() {
		return {
			showCoupon: false,
			showCertificate: false,
			showzizhibabankuai: false,
			week: '',
			$image: this.$image,
		}
	},
	created() {
		let days = ['周一', '周二', '周三', '周四', '周五', '周六', '周七']
		let str = this.arr.work_week
		let arr = str.split(',')
		arr = days
		this.week = arr[0] + '至' + arr[arr.length - 1]
	},
	methods: {
		// 查看食品安全证书
		goCertificate() {
			this.certificate()
			// this.showCoupon = true
			this.showCertificate = true
		},
		// 拨打电话
		callphone() {
			// this.callNumber()
			uni.makePhoneCall({
				phoneNumber: this.arr.mobile,
				success: function () {
				},
				fail: function () {
				}
			});
		},
	}
}
</script>

<style lang="less" scoped>
.shopContent {
	padding: 25rpx;
	min-height: 804rpx;
	background: #fff;
	border-radius: 40rpx 40rpx 0rpx 0rpx;

	.schoolLoaction,
	.certificate,
	.service,
	.time,
	.title {

		height: 64rpx;
		line-height: 64rpx;
		font-size: 28rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: #565961;
	}

	.schoolLoaction {
		display: flex;
		justify-content: space-between;
		align-items: center;

		.addLocation {
			padding-left: 42rpx;
			height: 96rpx;
			line-height: 96rpx;
			font-size: 28rpx;
			font-family: PingFang SC;
			background: url('../../static/order/grayAdd.png') no-repeat center left;
			background-size: 33rpx 28rpx;
			font-weight: 400;
			color: #565961;

			overflow: hidden;
			text-overflow: ellipsis;
			white-space: nowrap;
		}

		img {
			display: inline-block;
			width: 33rpx;
			height: 33rpx;
		}

		image {
			display: inline-block;
			width: 33rpx;
			height: 33rpx;
		}
	}

	.imgContent {

		display: flex;
		justify-content: space-between;
		height: 100%;
		padding-bottom: 37rpx;
		border-bottom: 1rpx solid #EEEDE9;

		.picList {
			margin-right: 15rpx;
			width: 207rpx;
			height: 154rpx;

			img {
				width: 100%;
				height: 100%;
				border-radius: 8rpx;
			}

			image {
				width: 100%;
				height: 100%;
				border-radius: 8rpx;
			}
		}

		.picList:last-child {
			margin-right: 0;
		}
	}

	.certificate {
		display: flex;
		justify-content: space-between;
		padding-left: 39rpx;
		background: url('../../static/order/book.png') no-repeat center left;
		background-size: 28rpx 31rpx;
	}

	.goCertificate {
		display: block;
		color: #B6B8BC;
	}

	.service,
	.time {
		padding-left: 41rpx;
		background: url('../../static/order/car.png') no-repeat center left;
		background-size: 31rpx 27rpx;
	}

	.time {
		margin-bottom: 45rpx;
	}

	.shop {
		padding-top: 15px;
		border-top: 1rpx solid #EEEDE9;

		.title {
			padding-left: 41rpx;
			background: url('../../static/order/busShop.png') no-repeat center left;
			background-size: 28rpx 25rpx;
		}

		.compensation,
		.protect {

			height: 43rpx;
			line-height: 43rpx;
			font-size: 22rpx;
			font-family: PingFang SC;
			font-weight: 400;
			color: #8B8E97;
		}

		.pei,
		.bao {
			display: inline-block;
			margin-right: 10rpx;
			width: 20rpx;
			height: 20rpx;
		}

		.pei {
			background: url('../../static/order/pei.png') no-repeat center left;
			background-size: 20rpx 20rpx;
		}

		.bao {
			background: url('../../static/order/xc-safe.png') no-repeat center left;
			background-size: 20rpx 20rpx;
		}
	}

	// 食品安全证书
	.content_Cert {
		display: flex;
		flex-direction: column;
		align-items: center;

		.bookTitle {
			height: 107rpx;
			line-height: 107rpx;
			font-size: 34rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #161415;
		}

		img {
			width: 637rpx;
			height: 478rpx;
		}

		image {
			width: 637rpx;
			height: 478rpx;
		}
	}
}
</style>
